import React, { PureComponent } from 'react';
import { Result, Button } from 'antd';
import { connect } from 'dva';
import "./form.less"
class SubmitResults extends PureComponent {
    constructor(props) {
        super(props);
        this.state = {
        }
        this.backHome = this.backHome.bind(this)
    }
    backHome(e) {
        e.preventDefault()
        const { pre, preText, goInnerPage } = this.props;
        if(pre){
            goInnerPage(null, pre, preText)
        }else{
            this.props.continueEdit()
        }
        
    }
    continue() {

    }
    render() {
        let { continueEdit, backHome } = this.props;
        return (
            <Result
                status="success"
                title="操作成功!"
                subTitle="返回主页&nbsp;|&nbsp;继续操作"
                extra={[
                    <Button onClick={this.backHome} type="primary" key="backHome">返回主页</Button>,
                    <Button onClick={continueEdit} key="continueEdit">继续操作</Button>,
                ]}
            />
        )
    }
}
export default connect(
    ({ }) => ({}),
    dispatch => ({

    })
)(SubmitResults);